Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to disable/remove an action from Mass(Tree)Action #20881

Merged
merged 3 commits into from
Feb 14, 2019
Merged

Add the ability to disable/remove an action from Mass(Tree)Action #20881

merged 3 commits into from
Feb 14, 2019

Conversation

Beagon
Copy link
Contributor

@Beagon Beagon commented Feb 1, 2019

Description (*)

What: I'm proposing the ability to easily disable/remove an action from Mass(Tree)Action by adding a setting "actionDisable" to actions.

Why: To get this working without this feature I had to overwrite the MassAction UiComponent class in Vendor\Module\view\Area\ui_component with a custom version. Since you can normally disable UiComponents via a disable argument, I thought that it should be just as easy for Mass(Tree)Actions.

Before (Print Invoice is still there):
With Action

After:
With action removed

Manual testing scenarios (*)

  1. Create a custom module
  2. Create a UI Component overwrite in Vendor/Module/view/adminhtml/ui_component/sales_order_grid.xml and fill it with this:
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <container name="listing_top">
        <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions" class="Comprex\DisableInvoicePrinting\Ui\MassAction">
            <action name="pdfinvoices_order">
                <settings>
                    <actionDisable>false</actionDisable>
                </settings>
            </action>
        </massaction>
    </container>
</listing>
  1. Flush Cache
  2. Go to http://url.tld/admin/sales/order
  3. View if the "Print Invoices" option is removed.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @Beagon. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 1, 2019

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-4084 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@Beagon thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@Beagon Beagon added the Partner: Itonomy PR created by partner Itonomy label Feb 1, 2019
@magento-engcom-team magento-engcom-team merged commit 4461a29 into magento:2.3-develop Feb 14, 2019
@ghost
Copy link

ghost commented Feb 14, 2019

Hi @Beagon, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.2 milestone Feb 14, 2019
@Beagon Beagon deleted the feature/DisableMassActionSetting branch February 15, 2019 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants